namespace ns1
{
    using DukeyTbker.Properties;
    using System;
    using System.CodeDom.Compiler;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.Runtime.CompilerServices;
    using System.Threading;
    using System.Web.Services;
    using System.Web.Services.Description;
    using System.Web.Services.Protocols;

    [WebServiceBinding(Name="SoftCaiJIAPISoap", Namespace="http://www.yunaishuo.com/"), DesignerCategory("code"), GeneratedCode("System.Web.Services", "2.0.50727.5420"), DebuggerStepThrough]
    public class SoftCaiJIAPI : SoapHttpClientProtocol
    {
        private bool bool_0;
        private SendOrPostCallback sendOrPostCallback_0;
        private SendOrPostCallback sendOrPostCallback_1;

        public event GDelegate0 gdelegate0_0;

        public event GDelegate1 gdelegate1_0;

        public SoftCaiJIAPI()
        {
            this.Url = Settings.Default.DukeyTbker_com_yunaishuo_www_SoftCaiJIAPI;
            if (this.method_2(this.Url))
            {
                this.UseDefaultCredentials = true;
                this.bool_0 = false;
            }
            else
            {
                this.bool_0 = true;
            }
        }

        public void CancelAsync(object object_0)
        {
            base.CancelAsync(object_0);
        }

        [SoapDocumentMethod("http://www.yunaishuo.com/GetChannel", RequestNamespace="http://www.yunaishuo.com/", ResponseNamespace="http://www.yunaishuo.com/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)]
        public Channel[] GetChannel(string RSAKey)
        {
            return (Channel[]) base.Invoke("GetChannel", new object[] { RSAKey })[0];
        }

        public void GetChannelAsync(string string_0)
        {
            this.GetChannelAsync(string_0, null);
        }

        public void GetChannelAsync(string string_0, object object_0)
        {
            if (this.sendOrPostCallback_0 == null)
            {
                this.sendOrPostCallback_0 = new SendOrPostCallback(this.method_0);
            }
            base.InvokeAsync("GetChannel", new object[] { string_0 }, this.sendOrPostCallback_0, object_0);
        }

        private void method_0(object object_0)
        {
            if (this.gdelegate0_0 != null)
            {
                InvokeCompletedEventArgs args = (InvokeCompletedEventArgs) object_0;
                this.gdelegate0_0(this, new GEventArgs0(args.Results, args.Error, args.Cancelled, args.UserState));
            }
        }

        private void method_1(object object_0)
        {
            if (this.gdelegate1_0 != null)
            {
                InvokeCompletedEventArgs args = (InvokeCompletedEventArgs) object_0;
                this.gdelegate1_0(this, new GEventArgs1(args.Results, args.Error, args.Cancelled, args.UserState));
            }
        }

        private bool method_2(string string_0)
        {
            if ((string_0 == null) || (string_0 == string.Empty))
            {
                return false;
            }
            Uri uri = new Uri(string_0);
            return ((uri.Port >= 0x400) && (string.Compare(uri.Host, "localHost", StringComparison.OrdinalIgnoreCase) == 0));
        }

        [SoapDocumentMethod("http://www.yunaishuo.com/PublishCaiji", RequestNamespace="http://www.yunaishuo.com/", ResponseNamespace="http://www.yunaishuo.com/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)]
        public string PublishCaiji(tbproductasmx[] list, string channelid, string RSAKey)
        {
            return (string) base.Invoke("PublishCaiji", new object[] { list, channelid, RSAKey })[0];
        }

        public void PublishCaijiAsync(tbproductasmx[] tbproductasmx_0, string string_0, string string_1)
        {
            this.PublishCaijiAsync(tbproductasmx_0, string_0, string_1, null);
        }

        public void PublishCaijiAsync(tbproductasmx[] tbproductasmx_0, string string_0, string string_1, object object_0)
        {
            if (this.sendOrPostCallback_1 == null)
            {
                this.sendOrPostCallback_1 = new SendOrPostCallback(this.method_1);
            }
            base.InvokeAsync("PublishCaiji", new object[] { tbproductasmx_0, string_0, string_1 }, this.sendOrPostCallback_1, object_0);
        }

        public string Url
        {
            get
            {
                return base.Url;
            }
            set
            {
                if ((this.method_2(base.Url) && !this.bool_0) && !this.method_2(value))
                {
                    base.UseDefaultCredentials = false;
                }
                base.Url = value;
            }
        }

        public bool UseDefaultCredentials
        {
            get
            {
                return base.UseDefaultCredentials;
            }
            set
            {
                base.UseDefaultCredentials = value;
                this.bool_0 = true;
            }
        }
    }
}

